﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Collections;
using LightingImportTool.Model;
using Tools;

namespace LightingImportTool
{

    public partial class ImageForm : Form
    {
        public ImageForm(ImageModel imageModel, ImageFile imageFile)
        {
            InitializeComponent();

            Image image = SerializeHelper.ByteArrayToImage(imageFile.File);
            this.pictureBox1.Width = image.Width;
            this.pictureBox1.Height = image.Height;
            this.pictureBox1.Image = image;
            this.sizeValueLable.Text = string.Format("{0} x {1}", image.Width, image.Height);
            this.formatValueLable.Text = string.Format("{0} 图像", imageModel.Format.Replace(".", "").ToUpper());
            long lengthInK = imageModel.Length / 1024;
            this.lengthValueLable.Text = string.Format("{0} KB", lengthInK.ToString("N0"));
        }
    }
}
